package com.maksimtech.aratestingunit;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;
//import android.widget.Toast;

public class TestingUnit extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    
    @Override
    public void onResume() {
    	String text;
    	
    	super.onResume();
    	AnotherReaderAPI reader = new AnotherReaderAPI();
    	
    	ProgressDialog progressDialog = ProgressDialog.show(this, "Please wait...", "Logging in...");
    	reader.login("gregor.dutz@gmail.com", "Fensterbank2010", "Maksim");
    	progressDialog.dismiss();
    	
    	if (reader.getLoginStatus() == true) text = reader.getUnreadCount().toString();
    	else text = "Not logged in.";
    	
    	TextView t = new TextView(this); 
		t = (TextView) findViewById(R.id.statusField); 
    	
    	if (text != null) t.setText(text);
    	else t.setText("Error");
    	
    }
    
}